#include<bits/stdc++.h>
using namespace std;
int r[100005],n,t[100005]={0},t1[100005]={0},num;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    num=n;
    for(int i=1;i<=n;i++) cin>>r[i];
    for(int i=1;i<=n;i++) t[r[i]]+=1;
    for(int i=1;i<=n;i++) t1[r[i]]+=1;
    for(int i=1;i<=100004;i++) {
        int j=1;
        t1[i]=0;
        while (t[i]>0 and i+j<=100004){
            if (t1[i+j]==0) {
                j++;
                continue;
            }
            if (t[i]<=t1[i+j]){
                t1[i+j]-=t[i];
                num-=t[i];
                t[i]=0;
            }
            else {
                t[i]-=t1[i+j];
                num-=t1[i+j];
                t1[i+j]=0;
            }
            j++;
        }
    }
    cout<<num;
    return 0;
}
